package saei.utils;

import java.text.SimpleDateFormat;
import java.util.Date;

public  class DateTimeFormatter {
	
	public static String formatedDate(Date date, String format) {
		
		String retVal = "";
		
		if (date != null) {
			try {
				SimpleDateFormat spd = new SimpleDateFormat(format);
				retVal = spd.format(date);
			} catch (Exception e) {
			}
		}
		
		return retVal;
	}
	
	public static String formatedDate(Date date) {
		return formatedDate(date, "dd/MM/yyy");
	}
	
	public static String formatedTime(Date date) {
		return formatedDate(date, "HH:mm:ss");
	}
	
	public static String formatedDateTime(Date date) {
		return formatedDate(date, "dd/MM/yyy HH:mm:ss");
	}
	
}
